package com.sxl.mapper;

import com.sxl.domain.Userroles;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.catalina.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
* @author xue
* @description 针对表【userroles】的数据库操作Mapper
* @createDate 2022-04-18 12:20:36
* @Entity com.sxl.domain.Userroles
*/
@Mapper
@Repository
public interface UserrolesMapper extends BaseMapper<Userroles> {
    /**
     *查询用户都有什么角色
     * @param id
     * @return 返回类型不同返回roles
     */
    List<Userroles> selectUserrolesById(Integer id);

    /**
     * 删除用户角色
     * @param userId
     * @param roleId
     * @return
     */
    int deleteUserroles(Integer userId,Integer roleId);

    /**
     * 3表联查，查询用户的角色     LoginName
     * @param id
     * @return
     */
    List<Userroles> selectUserAndUserrolesAndRolesById(Integer id);
}




